
const menu = [
  {
    compId: 2023050401,
    menuId: 1,
    menuNo: '1001',
    menuName: '系统管理',
    menuIconurl: 'system',
    menuPathurl: 'system',
    paraId: 0,
    menuSubList: [
      {
        menuId: 2,
        menuNo: '100101',
        menuName: '单位管理',
        menuPathurl: null,
        menuIconurl: null,
        paraId: 1
      },
      {
        menuId: 4,
        menuNo: '100103',
        menuName: '用户管理',
        menuPathurl: 'user',
        menuIconurl: 'user',
        paraId: 1
      },
      {
        menuId: 3,
        menuNo: '100102',
        menuName: '角色管理',
        menuPathurl: 'role',
        menuIconurl: 'peoples',
        paraId: 1
      },
      {
        menuId: 23,
        menuNo: '100104',
        menuName: '菜单管理',
        menuPathurl: 'menu',
        menuIconurl: 'tree-table',
        paraId: 1
      },
      {
        menuId: 22,
        menuNo: '100105',
        menuName: '图标管理',
        menuPathurl: 'icons',
        menuIconurl: 'icon',
        paraId: 1
      }
    ]
  },
  {
    compId: 2023050401,
    menuId: 20,
    menuNo: '1007',
    menuName: '日志管理',
    menuIconurl: 'log',
    menuPathurl: 'log',
    paraId: 0,
    menuSubList: [
      {
        menuId: 24,
        menuNo: '100702',
        menuName: '登录日志',
        menuPathurl: 'logininfor',
        menuIconurl: 'logininfor',
        paraId: 20
      },
      {
        menuId: 21,
        menuNo: '100701',
        menuName: '操作日志',
        menuPathurl: 'operlog',
        menuIconurl: 'form',
        paraId: 20
      }
    ]
  }
]

const roleInfoList = [
  {
    roleId: 1,
    compId: 2023050401,
    roleName: '系统管理员',
    roleIsdel: false,
    roleRemark: null,
    roleType: -1
  },
  {
    roleId: 2,
    compId: 2023050401,
    roleName: '系统管理员',
    roleIsdel: false,
    roleRemark: '报表统计',
    roleType: 1
  },
  {
    roleId: 4,
    compId: 2023050401,
    roleName: '系统调试',
    roleIsdel: true,
    roleRemark: '系统调试',
    roleType: 1
  },
  {
    roleId: 5,
    compId: 2023050401,
    roleName: 'admin',
    roleIsdel: false,
    roleRemark: '系统管理，日志管理',
    roleType: 1
  },
  {
    roleId: 6,
    compId: 2023050401,
    roleName: '系统调试01',
    roleIsdel: false,
    roleRemark: '系统调试01',
    roleType: 1
  },
  {
    roleId: 7,
    compId: 2023050401,
    roleName: '系统调试02',
    roleIsdel: false,
    roleRemark: '系统调试02',
    roleType: 1
  },
  {
    roleId: 8,
    compId: 2023050401,
    roleName: '系统调试03',
    roleIsdel: false,
    roleRemark: '系统调试03',
    roleType: 1
  },
  {
    roleId: 9,
    compId: 2023050401,
    roleName: '系统调试03',
    roleIsdel: false,
    roleRemark: '系统调试03',
    roleType: 1
  },
  {
    roleId: 10,
    compId: 2023050401,
    roleName: '系统调试03',
    roleIsdel: false,
    roleRemark: '系统调试03',
    roleType: 1
  },
  {
    roleId: 11,
    compId: 2023050401,
    roleName: '系统调试03',
    roleIsdel: false,
    roleRemark: '系统调试03',
    roleType: 1
  },
  {
    roleId: 12,
    compId: 2023050401,
    roleName: '系统调试03',
    roleIsdel: true,
    roleRemark: '系统调试03',
    roleType: 1
  }
]

const roleMenuRight = [
  {
    menuId: 1,
    paraId: 0,
    menuNo: '1001',
    menuName: '系统管理',
    checkState: true
  },
  {
    menuId: 2,
    paraId: 1,
    menuNo: '100101',
    menuName: '单位管理',
    checkState: true
  },
  {
    menuId: 3,
    paraId: 1,
    menuNo: '100102',
    menuName: '角色管理',
    checkState: true
  },
  {
    menuId: 4,
    paraId: 1,
    menuNo: '100103',
    menuName: '用户管理',
    checkState: true
  },
  {
    menuId: 5,
    paraId: 0,
    menuNo: '1002',
    menuName: '资产管理',
    checkState: true
  },
  {
    menuId: 7,
    paraId: 0,
    menuNo: '1003',
    menuName: '集中管控',
    checkState: true
  },
  {
    menuId: 8,
    paraId: 7,
    menuNo: '100301',
    menuName: 'LED屏幕',
    checkState: true
  },
  {
    menuId: 9,
    paraId: 7,
    menuNo: '100302',
    menuName: '屏幕调节',
    checkState: true
  },
  {
    menuId: 10,
    paraId: 7,
    menuNo: '100303',
    menuName: '屏幕监控',
    checkState: true
  },
  {
    menuId: 11,
    paraId: 0,
    menuNo: '1004',
    menuName: '智慧用电',
    checkState: true
  },
  {
    menuId: 12,
    paraId: 11,
    menuNo: '100401',
    menuName: '远程操控',
    checkState: true
  },
  {
    menuId: 13,
    paraId: 11,
    menuNo: '100402',
    menuName: '电气监控',
    checkState: true
  },
  {
    menuId: 14,
    paraId: 11,
    menuNo: '100403',
    menuName: '能耗分析',
    checkState: true
  },
  {
    menuId: 15,
    paraId: 0,
    menuNo: '1005',
    menuName: '智能预警',
    checkState: true
  },
  {
    menuId: 16,
    paraId: 15,
    menuNo: '100501',
    menuName: '预警设置',
    checkState: true
  },
  {
    menuId: 17,
    paraId: 15,
    menuNo: '100502',
    menuName: '报警信息',
    checkState: true
  },
  {
    menuId: 18,
    paraId: 0,
    menuNo: '1006',
    menuName: '保修管家',
    checkState: true
  },
  {
    menuId: 19,
    paraId: 18,
    menuNo: '100601',
    menuName: '工单处理',
    checkState: false
  },
  {
    menuId: 20,
    paraId: 0,
    menuNo: '1007',
    menuName: '日志管理',
    checkState: false
  },
  {
    menuId: 21,
    paraId: 20,
    menuNo: '100701',
    menuName: '操作日志',
    checkState: false
  },
  {
    menuId: 22,
    paraId: 1,
    menuNo: '100105',
    menuName: '图标管理',
    checkState: false
  },
  {
    menuId: 23,
    paraId: 1,
    menuNo: '100104',
    menuName: '菜单管理',
    checkState: false
  },
  {
    menuId: 24,
    paraId: 20,
    menuNo: '100702',
    menuName: '登录日志',
    checkState: false
  }
]

const router = [
  {
    "name": "System",
    "path": "/system",
    "hidden": false,
    "redirect": "noRedirect",
    "component": "Layout",
    "alwaysShow": true,
    "meta": {
      "title": "系统管理",
      "icon": "system",
      "noCache": false,
      "link": null
    },
    "children": [
      {
        "name": "User",
        "path": "user",
        "hidden": false,
        "component": "system/user/index",
        "meta": {
          "title": "用户管理",
          "icon": "user",
          "noCache": false,
          "link": null
        }
      },
      {
        "name": "Role",
        "path": "role",
        "hidden": false,
        "component": "system/role/index",
        "meta": {
          "title": "角色管理",
          "icon": "peoples",
          "noCache": false,
          "link": null
        }
      },
      {
        "name": "Menu",
        "path": "menu",
        "hidden": false,
        "component": "system/menu/index",
        "meta": {
          "title": "菜单管理",
          "icon": "tree-table",
          "noCache": false,
          "link": null
        }
      },
      {
        "name": "Dept",
        "path": "dept",
        "hidden": false,
        "component": "system/dept/index",
        "meta": {
          "title": "部门管理",
          "icon": "tree",
          "noCache": false,
          "link": null
        }
      },
      // {
      //   "name": "Log",
      //   "path": "log",
      //   "hidden": false,
      //   "redirect": "noRedirect",
      //   "component": "ParentView",
      //   "alwaysShow": true,
      //   "meta": {
      //     "title": "日志管理",
      //     "icon": "log",
      //     "noCache": false,
      //     "link": null
      //   },
      //   "children": [
      //     {
      //       "name": "Operlog",
      //       "path": "operlog",
      //       "hidden": false,
      //       "component": "monitor/operlog/index",
      //       "meta": {
      //         "title": "操作日志",
      //         "icon": "form",
      //         "noCache": false,
      //         "link": null
      //       }
      //     },
      //     {
      //       "name": "Logininfor",
      //       "path": "logininfor",
      //       "hidden": false,
      //       "component": "monitor/logininfor/index",
      //       "meta": {
      //         "title": "登录日志",
      //         "icon": "logininfor",
      //         "noCache": false,
      //         "link": null
      //       }
      //     }
      //   ]
      // }
    ]
  }
];

export default [
  // 查询菜单列表
  {
    url: '/dev-api/role/getRoleMenuList',
    type: 'get',
    response: (_) => {
      return {
        code: 200,
        data: router,
        total: router.length,
        message: 'success'
      }
    }
  },

  // 查询角色列表
  {
    url: '/dev-api/role/getRoleInfoList',
    type: 'get',
    response: (_) => {
      return {
        code: 200,
        data: roleInfoList,
        total: roleInfoList.length,
        message: 'success'
      }
    }
  },

  // 根据角色ID查询菜单权限
  {
    url: '/dev-api/role/roleMenuRight',
    type: 'get',
    response: (config) => {
      if (!config.body) {
        return {
          code: 50008,
          message: 'Login failed, unable to get roleMenuRight.'
        }
      } else {
        return {
          code: 200,
          total: roleMenuRight.length,
          data: roleMenuRight
        }
      }
    }
  }
]
